-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dml: support default expression cache when insert #15216
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15216 +/- ##
===========================================
Coverage ? 80.3768%
===========================================
Files ? 502
Lines ? 133857
Branches ? 0
===========================================
Hits ? 107590
Misses ? 17827
Partials ? 8440 |
executor/insert_common.go
Outdated
val types.Datum | ||
// default expr like `nextval(seq)` should be evaluated row by row. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are other default expressions implemented? e.g. current_timestamp().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insert into (now()),(now())... only eval once, treated as constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment format is like expr(variable name) ...
.
995a092
to
7dc9eb6
Compare
ddl/sequence_test.go
Outdated
for i := 0; i < 100; i++ { | ||
s.tk.MustExec(sql) | ||
} | ||
// fmt.Println(time.Now().Sub(start) / 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely, this just show how we bench it.
/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
/merge |
/run-all-tests |
@AilinKid merge failed. |
/merge |
/run-all-tests |
/merge |
/run-all-tests |
@AilinKid merge failed. |
/merge |
/run-all-tests |
What problem does this PR solve?
support default expression cache when insert.
It will accelerate the eval speed of the column with a default expression.
simple bench:
before
now
What is changed and how it works?
Check List
Tests
Release note